package com.zifeng.constant;

import java.util.concurrent.TimeUnit;

public class RedisConstants {
    public static final String SHIP_PREFIX = "ship_project:ship:";
    public static final String USER_PREFIX = "ship_project:user:";
    public static final String SHIP_PAGE_PREFIX = "ship_project:ship:page:";
    public static final String SHIP_PAGE_SIZE_PREFIX = ":pagesize:";

    public static final String SHIP_PAGE_LIST = "list";
    public static final String SHIP_PAGE_TOTAL= "total";

    // ttl
    public static final TimeUnit TTL_TIME_UNIT = TimeUnit.SECONDS;
    // 用户数据过期时间
    public static final int USER_TTL = 3;
    // 船只数据过期时间
    public static final int SHIP_TTL = 10;
    public static final int SHIP_NULL_TTL = 30;
    public static final int SHIP_PAGE_TTL = 5;

    public static final String LOGIN_TOKEN_KEY = "ship_project:user:login:token";

    public static final Integer TOKEN_TTL = 3600;

    // 布隆过滤器
    // 预期插入数量
    public static final long EXPECTED_INSERTIONS = 1000_0000L;
    // 误判率
    public static final double FALSE_PROBABILITY = 0.01;

    public static final String SHIP_ID_BLOOM_FILTER= "ship:bloom_filter";

}
